﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>
			相册管理
		</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="./../../static/back/css/x-admin.css" media="all">
		
	</head>

	<body>
		<div style="padding:5px 15px;">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
				<legend>新增推荐</legend>
			</fieldset>
			 
		<form class="layui-form" action="" lay-filter="myfrm" id="frm">
        {% csrf_token %}
            <input type="hidden" name="aid" value="{{ aobj.id }}">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">标题</label>
					<div class="layui-input-inline">
						<input type="text" name="title" readonly value="{{ aobj.title }}" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input" />
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">分类</label>
					<div class="layui-input-inline">
						<input type="text" name="showtype" readonly value="{{ aobj.showtype }}" lay-verify="required"  autocomplete="off" class="layui-input" />
					</div>

				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">位置</label>
					<div class="layui-input-inline">
						<select id="type" name="posid">
						<option value="">请选择</option>
                        <option value="1">网站首页</option>
						<option value="3">我的日记</option>
					</select>
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">权重值</label>
				<div class="layui-input-inline">
						<input type="text" name="weight" lay-verify="required"  autocomplete="off" class="layui-input" />
					</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit="" lay-filter="add">立即推荐</button>
				</div>
			</div>
		</form>

		</div>
		<script src="../../../static/back/lib/layui/layui.js" charset="utf-8"></script>
        <script src="../../../static/back/js/x-layui.js" charset="utf-8"></script>
		<script>
			layui.use(['form','layer','upload','jquery'], function(){
                    var form=layui.form,
                        layer=layui.layer,
                        $=layui.$;

                form.on('submit(add)',function () {
                    var url='/back/addxiangcetj';
                    var param=$('#frm').serialize()
                    $.post(url,param,function (res) {
                        //res 服务器响应的数据
                        if(res.success){
                            parent.layer.close(layer.index);
                            window.parent.location.reload();
                            layer.msg('推荐成功')
                        }else{
                            layer.msg(res.message,{time:6000})
                        }
                        parent.layer.close(layer.index);
                    },'json')
                    return false;
                })
            });
		</script>